{% extends "enterprise/base.html" %}
{% block css %}
{% endblock %}
{% block content %}
        <script type="text/javascript">
            var primary_menu = "menu_3";
            var sub_menu = "menu_3_0";
        </script>
        <div class="row">
            <div class="col-md-12">
            <form method="post" enctype="application/x-www-form-urlencoded" class="formSubmit">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="panel-title"><h3>污染防治基本信息</h3></div>
                        <div class="panel-options">
                            <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a>
                        </div>
                    </div>
                    <div class="panel-body with-table">
                        <table class="input_in table-detail">
                            <tr>
                                <th colspan="9">废气</th>
                            </tr>
                            <tr>
                                <th width="230">废气排放量（万立方米/年）</th>
                                <td><input datatype="n" type="text" value="{{ exhaust.exhaust_let }}" name="exhaust_let"></td>
                                <th width="230">排气筒数量（个）</th>
                                <td><input datatype="n" type="text" value="{{ exhaust.count }}" name="e_count"></td>
                            </tr>
                            <tr>
                                <th>是否有批复常规污染物排放</th>
                                <td colspan="3">
                                    <input checked="checked" type="radio" name="is_cgwrwpf" value="1">
                                    是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="is_cgwrwpf">否
                                </td>
                            </tr>
                            <tr>
                                <th>批复常规污染物排放总量</th>
                                <td colspan="3">
                                {% if exhaust.getTotalemission %}
                                    {% for ex in exhaust.getTotalemission %}
                                    <table style="width:100%">
                                        <tr>
                                            <td>
                                                <select name="e_t_type">
                                                    {% ifequal ex.type '1'%}
                                                    <option value="1" selected="selected">SO2（吨/年）</option>
                                                    <option value="2">NOx（吨/年）</option>
                                                    <option value="3">粉尘（吨/年）</option>
                                                    <option value="4">总烃（吨/年）</option>
                                                    {% endifequal %}
                                                {% ifequal ex.type '2'%}
                                                    <option value="1">SO2（吨/年）</option>
                                                    <option value="2" selected="selected">NOx（吨/年）</option>
                                                    <option value="3">粉尘（吨/年）</option>
                                                    <option value="4">总烃（吨/年）</option>
                                                    {% endifequal %}
                                                {% ifequal ex.type '3'%}
                                                    <option value="1">SO2（吨/年）</option>
                                                    <option value="2">NOx（吨/年）</option>
                                                    <option value="3" selected="selected">粉尘（吨/年）</option>
                                                    <option value="4">总烃（吨/年）</option>
                                                    {% endifequal %}
                                                {% ifequal ex.type '4'%}
                                                    <option value="1">SO2（吨/年）</option>
                                                    <option value="2">NOx（吨/年）</option>
                                                    <option value="3">粉尘（吨/年）</option>
                                                    <option value="4" selected="selected">总烃（吨/年）</option>
                                                    {% endifequal %}
                                                </select>
                                            </td>
                                            <td><input datatype="n" type="text" value="{{ ex.count }}" name="e_t_count"></td>
                                            <td width="60">
                                                <input type="button" value="添加" class="btn btn-success" onclick="addFile(this)">
                                            </td>
                                        </tr>
                                    </table>
                                    {% endfor %}
                                {% else %}
                                    <table style="width:100%">
                                        <tr>
                                            <td>
                                                <select name="e_t_type">
                                                    <option value="1">SO2（吨/年）</option>
                                                    <option value="2">NOx（吨/年）</option>
                                                    <option value="3">粉尘（吨/年）</option>
                                                    <option value="4">总烃（吨/年）</option>
                                                </select>
                                            </td>
                                            <td><input datatype="n" type="text" value="" name="e_t_count"></td>
                                            <td width="60"><input type="button" value="添加" class="btn btn-success" onclick="addFile(this)"></td>
                                        </tr>
                                    </table>
                                    {% endif %}
                                </td>                                
                            </tr>

                        </table>
                        <br>
                        <table class="input_in table-detail">
                            <tr>
                                <th colspan="9">废水</th>
                            </tr>
                            <tr>
                                <th width="230">废水产生量（吨/年）</th>
                                <td><input datatype="n" type="text" value="{{ water.water_produce }}" name="water_produce"></td>
                                <th width="230">废水排放（接管）量（吨/年）</th>
                                <td><input datatype="n" type="text" value="{{ water.water_let }}" name="water_let"></td>
                            </tr>
                            <tr>
                                <th>是否接管污水处理厂</th>
                                <td colspan="3">
                                    {% ifequal water.is_takeover '1' %}
                                    <input checked="checked" type="radio" name="is_takeover" value="1">
                                    是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="is_takeover">否
                                    {% endifequal %}
                                   {% ifequal water.is_takeover '0' %}
                                    <input type="radio" name="is_takeover" value="1">
                                    是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="is_takeover" checked="checked">否
                                   {% else %}
                                       <input type="radio" name="is_takeover" value="1">
                                    是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="is_takeover" checked="checked">否
                                   {% endifequal %}
                                </td>
                            </tr>
                            <tr>
                                <th>废水排放去向类型</th>
                                <td><input datatype="*" type="text" value="{{ water.water_let_type }}" name="water_let_type"></td>
                                <th>最终受纳水体名称</th>
                                <td><input datatype="*" type="text" value="{{ water.last_water_name }}" name="last_water_name"></td>
                            </tr>

                            <tr>
                                <th>是否有批复常规污染物排放</th>
                                <td colspan="3">
                                    <input checked="checked" type="radio" name="is_cgwrw" value="1">
                                    是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="0" name="is_cgwrw">否
                                </td>
                            </tr>
                            <tr>
                                <th>批复常规污染物排放（接管）总量</th>
                                <td colspan="3">
                                    <table style="width:100%">
                                     {% if water.getTotalemission %}
                            {% for wg in water.getTotalemission %}
                                        <tr>
                                            <td>
                                                <select name="w_type">
                                                    {% ifequal wg.type '1' %}
                                                    <option value="1" selected="selected">COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                      {% ifequal wg.type '2' %}
                                                    <option value="1" >COD（吨/年）</option>
                                                    <option value="2" selected="selected">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                      {% ifequal wg.type '3' %}
                                                    <option value="1" >COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3" selected="selected">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                      {% ifequal wg.type '4' %}
                                                    <option value="1">COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4" selected="selected">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                      {% ifequal wg.type '5' %}
                                                    <option value="1" >COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5" selected="selected">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                {% ifequal wg.type '6' %}
                                                    <option value="1" >COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6" selected="selected">石油类（吨/年）</option>
                                                    {% endifequal %}
                                                </select>
                                            </td>
                                            <td><input datatype="n" type="text" value="{{ wg.count }}" name="w_count"></td>
                                            <td width="60"><input type="button" value="添加" class="btn btn-success" onclick="addFile(this)"></td>
                                        </tr>
                                           {% endfor %}
                            {% else %}
                                      <tr>
                                <th>批复常规污染物排放（接管）总量</th>
                                <td colspan="3">
                                    <table style="width:100%">
                                        <tr>
                                            <td>
                                                <select name="w_type">
                                                    <option value="1" >COD（吨/年）</option>
                                                    <option value="2">氨氮（吨/年）</option>
                                                    <option value="3">总氮（吨/年）</option>
                                                    <option value="4">总磷（吨/年）</option>
                                                    <option value="5">挥发酚（吨/年）</option>
                                                    <option value="6">石油类（吨/年）</option>
                                                </select>
                                            </td>
                                            <td><input datatype="n" type="text" value="{{ wg.count }}" name="w_count"></td>
                                            <td width="60"><input type="button" value="添加" class="btn btn-success" onclick="addFile(this)"></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        {% endif %}
                                    </table>                                    
                                </td>                                
                            </tr>


                        </table>
                        <br>
                        <table class="input_in table-detail">
                            <tr>
                                <th colspan="9">固废</th>
                            </tr>
                            <tr>
                                <th width="230">一般固体废物产生量（吨/年）</th>
                                <td><input datatype="n" type="text" value="{{ solid.common_number }}" name="common_number"></td>
                                <th width="230">危险废物产生量（吨/年）</th>
                                <td><input datatype="n" type="text" value="{{ solid.wx_number }}" name="wx_number"></td>
                            </tr>
                            <tr>
                                <th>危险废物处置方式（可多选）</th>
                                <td>
                                    {% ifequal solid.wxfw_type '1' %}
                                    <input  type="checkbox" name="wxfw_type" value="1" checked="checked">
                                    自行处理 &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" value="0" name="wxfw_type">委托处理
                                    {% endifequal %}

                                {% ifequal solid.wxfw_type '0' %}
                                    <input  type="checkbox" name="wxfw_type" value="1">
                                    自行处理 &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" value="0" name="wxfw_type" checked="checked">委托处理
                                {% endifequal %}
                                {% ifequal solid.wxfw_type '10' %}
                                    <input  type="checkbox" name="wxfw_type" value="1" checked="checked">
                                    自行处理 &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" value="0" name="wxfw_type" checked="checked">委托处理
                                    {% else %}
                                        <input  type="checkbox" name="wxfw_type" value="1" checked="checked">
                                    自行处理 &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" value="0" name="wxfw_type" checked="checked">委托处理
                                {% endifequal %}
                                </td>
                                <th>危险废物处置单位名称</th>
                                <td><input datatype="*" type="text" value="{{ solid.wxfw_name }}" name="wxfw_name"></td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="buttons">
			        <input onclick="submitSave()" type="submit" class="btn btn-orange btn-lg" value="暂存">
                                <input type="submit" class="btn btn-success btn-lg" value="确认">
			        <!-- <input class="btn btn-info btn-lg" type="reset" value="重置"/> -->
			    </div>
			    </form>
            </div>
        </div>
{% endblock %}
{% block js %}
<script type="text/javascript">
    $("input[name='is_cgwrw'],input[name='is_cgwrwpf']").change(function(){
        if (this.value==1) {
            $(this).parents("tr").next().show();
        }else{
            $(this).parents("tr").next().hide();
        }
    })
</script>
{% endblock %}